#pragma once
#ifndef MYSTACK
#define MYSTACK
#include<iostream>
template <typename T>
struct mystack
{
	T* arry;
	int sp;
	int size;
	mystack()
	{
		arry = new T;
		sp = 0;
		size = 0;
	}
	~mystack()
	{
		delete[] arry;
	}
	void push(T x)
	{
		arry[sp] = x;
		sp += 1;
		size += 1;
	}
	T pop()
	{
		sp = sp - 1;
		T buf = arry[sp];
		size -= 1;
		return buf;
	}
	T top()
	{
		int t = sp - 1;
		return arry[t];
	}
	void print()
	{
		for (int i = 0;i < size;i++)
			std::cout << arry[i] << "-";
		std::cout << std::endl;
	}
};

#endif
